//package cn.java79.quiz.web;
//
//import cn.java79.quiz.entity.Questions;
//import cn.java79.quiz.pojo.AjaxPage;
//import cn.java79.quiz.service.QuestionsService;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.io.PrintWriter;
///**
// * @author oldliu
// * @since 1.0
// */
//@WebServlet( "/questionSearch")
////@WebServlet( {"/questionSearch","/questions","/question"})
//public class QustionSearchServlet extends HttpServlet {
//    @Override
//    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        String title=req.getParameter("title");
//        AjaxPage<Questions> page = QuestionsService.ME.search(title, null, 1, 20);
//        resp.setContentType("text/html;charset=utf-8");
//        PrintWriter writer = resp.getWriter();//out对应
//        writer.write("<!DOCTYPE html>");
//        writer.write("<html>");
//        writer.write("<body>");
//        page.getData().forEach(x->{
//            writer.write("<div style='border:2px solid red;margin:5px;'>");
//            writer.println("<div>"+x.getTitle()+"</div>");
//            writer.println("<div>难度:"+x.getDifficulty()+"</div>");
//            writer.write("</div>");
//        });
//
//        writer.write("</body>");
//        writer.write("</html>");
//    }
//}
